<div class="myRightType">
	<div class="title">
		大牛列表
	</div>
	<div class="inner clearfix">
		<div class="box clearfix">
			<div class="row">
				<div class="col-md-2">
					<p>大牛列表</p>
				</div>
				<div class="col-md-10 tr">

					<div class="search rfoat">
						<input type="text" placeholder="输入MT5账号" id="Mow_mt5" />
						<i class="glyphicon glyphicon-search" id="Mow_search"></i>

					</div>

				</div>
			</div>
			<br />
			<table id="mowList" class="clearfix"></table>
		</div>

	</div>
</div>
<div id="mowMore" style="display: none;">
	<div class="wrap">

		<div class="row">

			<div class="col-md-4 col-sm-4">
				<div class="col-md-6 blue col-sm-6">
					账&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号：
				</div>
				<div class="col-md-6 col-sm-6" id="mtLogin">
					0
				</div>

			</div>

		</div>
		<div class="row">

			<div class="col-md-4 col-sm-4">
				<div class="col-md-6 blue col-sm-6">
					绑定人数：
				</div>
				<div class="col-md-6 col-sm-6" id="boundNumber">
					0
				</div>

			</div>
			<div class="col-md-4 col-sm-4">
				<div class="col-md-6 blue col-sm-6">
					持仓订单数：
				</div>
				<div class="col-md-6 col-sm-6" id="positionNumber">
					0
				</div>

			</div>
			<div class="col-md-4 col-sm-4">
				<div class="col-md-6 blue col-sm-6">
					持仓手数：
				</div>
				<div class="col-md-6 col-sm-6" id="positionVolume">
					0
				</div>

			</div>

		</div>
		<div class="row">

			<div class="col-md-4 col-sm-4">
				<div class="col-md-6  blue col-sm-6">
					跟单人数：
				</div>
				<div class="col-md-6 col-sm-6" id="documentaryNumber">
					0
				</div>

			</div>
			<div class="col-md-4 col-sm-4">
				<div class="col-md-6 blue col-sm-6">
					总跟单数：
				</div>
				<div class="col-md-6 col-sm-6" id="documentaryTotle">
					0
				</div>

			</div>
			<div class="col-md-4 col-sm-4">
				<div class="col-md-6  blue col-sm-6">
					跟单持仓：
				</div>
				<div class="col-md-6 col-sm-6" id="documentaryPrice">
					0
				</div>

			</div>

		</div>
		<table id="cowListTable"></table>

	</div>
</div>
<script type="text/javascript">
	$('#mowList').bootstrapTable({
		url: "/wechat_mt5/admin/daniel/list",
		method: 'get',
		columns: [{
			field: 'mtLogin',
			title: '账号'
		}, {
			field: 'name',
			title: '昵称',

		}, {
			field: 'banlance',
			title: '余额',

		}, {
			field: 'cleanValue',
			title: '净值',

		}, {
			field: 'orderTotal',
			title: '订单总数',

		}, {
			field: 'orderTotal',
			title: '订单总数',

		}, {
			field: 'transactionTotal',
			title: '交易总额',

		}, {
			field: 'transactionTotal',
			title: '交易总额',

		}, {
			field: 'documentaryCapital',
			title: '跟单资金',

		}, {
			field: 'documentaryNumber',
			title: '跟单人数',

		}, {
			field: 'id',
			title: '操作',
			formatter: caozuo,

		}],
		height: 650,
		pageSize: 10,
		pageList: [10, 25, 50, 100],
		showRefresh: true,
		editable: true,
		// onClickRow:operateEvents,
		// showColumns: true,
		pagination: true,
		//		striped: true,
		sidePagination: 'server',

	});

	function caozuo(value, row, index) {
		var info = JSON.stringify(row)
		return [
			"<button type='button' class='btn btn-primary' onclick='moreMow(" + info + ")'>详情</button><button type='button' class='btn btn-danger' onclick='delMow(" + info + ")'>删除</button>",

		].join("")

	}

	function delMow(info) {
		layui.use('layer', function() {
			var layer = layui.layer;
			layer.open({
				content: '您确定删除' + info.mtLogin,
				btn: ['确定', '取消'],
				yes: function(index, layero) {
					$.ajax({
						type: "delete",
						url: "/wechat_mt5/admin/delete/daniel/" + info.mtLogin,

						success: function(data) {
							if(data.code == "0") {
								prompt("删除成功！");
								$('#mowList').bootstrapTable(
									"refresh", {
										url: "/wechat_mt5/admin/daniel/list"
									}
								);

							}
						}

					})
				},
				btn2: function(index, layero) {
					layer.close(index)
						//按钮【按钮二】的回调

					//return false 开启该代码可禁止点击该按钮关闭
				}
			});

		});
	}

	function moreMow(info) {

		$.ajax({
			type: "get",
			url: "/wechat_mt5/admin/daniel/details",

			data: {
				mtLogin:info.mtLogin,

			},
			success: function(data) {

				if(data.code == 0) {
					for(x in data.data) {
						$("#" + x).html(data.data[x])

					}
					alertNew("查看详情", "963", "794", $("#mowMore"));
					$('#cowListTable').bootstrapTable({
						url: "/wechat_mt5/admin/daniel/details/table",
						method: 'get',
						queryParams: {
							mtLogin: info.mtLogin
						},
						columns: [{
							field: 'mtLogin',
							title: '跟单账号'
						}, {
							field: 'documentaryNumberHistory',
							title: '历史跟随订单数',

						}, {
							field: 'documentaryVolumeHistory',
							title: '历史跟单手数',

						}, {
							field: 'positionNumber',
							title: '当前持仓数',

						}, {
							field: 'positionVolume',
							title: '当前持仓手数',

						}],

						height: 500,
						pageSize: 10,
						pageList: [10, 25, 50, 100],
						showRefresh: true,
						editable: true,
						// onClickRow:operateEvents,
						// showColumns: true,
						pagination: true,
						//		striped: true,
						sidePagination: 'server',

					});

				} else {
					prompt("查看失败！")

				}
			}

		})

	}

	function lookMowName() {
		var user = $("#mt5").val();
		$('#exList').bootstrapTable('refresh', {
			query: {
				mtLogin: user,

			}
		});
	}

	lookSearch($("#Mow_search"), $("#Mow_mt5"), $('#mowList'));
</script>